from api.TokenApi import TokenApi
from api.AssignUploadUrlFirstTrueApi import AssignUploadUrlFirstTrueApi
from api.AssignUploadUrlTwoFalseApi import AssignUploadUrlTwoFalseApi
from api.PackageBotApi import PackageBotApi
from api.PackageJsonApi import PackageJsonApi
from api.CreateApi import CreateApi
from api.GetPackageBotApi import GetPackageBotApi
from api.ListApi import ListApi
from api.DetailApi import DetailApi
import uuid


class Dolowd:
    def __init__(self):
        pass

    def login(self):
        token_api = TokenApi()
        user_name = '17336606653'
        password = 'pBuXAJx2WmzMu6FbrWsA3DhwrI/q+tIplYVmpEfyevzHxNgUZ6oMDpXNVTn/q1GMcN3s1AD31HcjHk4OWC/AChhprGLqLBLYxEmjRmaC3cxod+AuGnWuvMARODV9gFj5qkxxSiTfCtQsAmWLzk440hmWoHSkWaKd+U9XvStY5A8='
        token_info = token_api.token(user_name, password)
        access_token = token_info.get('access_token')
        print(access_token)

    def list(self, access_token):
        listApi = ListApi()
        listApi.list(access_token)

    def detail(self, access_token, appId):
        detailApi = DetailApi()
        detailApi.detail(access_token, appId)

    def dol(self):
        url = "https://winrobot-pri-a.oss-cn-hangzhou.aliyuncs.com/robots/robot-90eff8e4-9f01-4061-a67a-793f18d96f6b/v-1/package.bot?Expires=1764259054&OSSAccessKeyId=LTAI5t93vfGfysekhtsfrZU9&Signature=PeH%2BtdqSND6mftenukqT4vXLTEA%3D"
        getPackageBotApi = GetPackageBotApi()
        getPackageBotApi.get_package_bot(url, appId)

    def refile(self):
        '''
        修改 json文件上传
        '''

if __name__ == '__main__':
    access_token = '9e6278ab-a764-4649-8275-cf1a97b17c97'
    appId = '90eff8e4-9f01-4061-a67a-793f18d96f6b'

    dolowd = Dolowd()
    # dolowd.list()
    # dolowd.detail()
    dolowd.dol()

